int longitud = 15; 
char notas[] = "ccggaagffeeddc "; 
int pulsacion[] = {1,1,1,1,1,1,2,1,1,1,1,1,1,2,4};
char nombres[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
int tonos[] = { 523, 587, 659, 698, 783, 880,98, 1047 };
int tempo = 350;

void setup() {
  pinMode(8, OUTPUT);
}

void loop() {
  int i;
  for (i = 0; i < longitud; i++) {
      if (notas[i] == ' ') {
          delay(pulsacion[i] * tempo); 
      } else {
          playNota(notas[i]);
          delay(pulsacion[i]*tempo); 
          noTone(8);
      }
  }
}

void playNota(char nota) {
  int i;
  for (i = 0; i < 8; i++) {
      if (nombres[i] == nota) {
          tone(8,tonos[i]);
      }
  }
}








